package collections.map;

import java.util.Map;
import java.util.TreeMap;

public class TreeMapDemo {

  public static void main(String[] args) {
    TreeMap<Integer, String> map = new TreeMap<>();
    map.put(2, "2");
    map.put(1, "1");

    for (Map.Entry<Integer, String> integerStringEntry : map.entrySet()) {
      System.out.println(integerStringEntry.getKey() + ":" + integerStringEntry.getValue());
    }

  }

}
